<!DOCTYPE html>
<html>
<head>
	<title>{$pageData.title}</title>
	<script type="text/javascript" src="__STATIC__/common/js/jquery.min.js"></script>
</head>
<body>
<div id="result">

</div>
<script type="text/javascript">
$(function(){
	getMap('{$mid}');
});
function getMap(mid){
	if(mid=='')
		return false;
	$.ajax({
		'type':'post',
		'dataType':'json',
		'data':'mid='+mid,
		'url':"{:url('agent.api/member_map')}",
		'success':function(data){
			var html = '';
			html += '<div class="a">'+data.data.mid+'[<a href="javascript:;" onclick="getMap(\''+data.data.up+'\')">上</a>][<a href="javascript:;" onclick="getMap(\''+data.data.down+'\')">下</a>]</div>';
			$.each(data.data.son,function(index,value){
				if(JSON.stringify(value) === '[]'){
					html += '<div class="b">————注册新用户</div>';
				}else{
					html += '<div class="b">————'+value.mid+'[<a href="javascript:;" onclick="getMap(\''+value.up+'\')">上</a>][<a href="javascript:;" onclick="getMap(\''+value.down+'\')">下</a>]</div>';
					$.each(value.son,function(i,v){
						if(JSON.stringify(v) === '[]'){
							html += '<div class="b">————————注册新用户</div>';
						}else{
							html += '<div class="c">————————'+v.mid+'[<a href="javascript:;" onclick="getMap(\''+v.up+'\')">上</a>][<a href="javascript:;" onclick="getMap(\''+v.down+'\')">下</a>]</div>';
						}
					})
				}
				
			})
			$("#result").html(html);
		}
	});
}
</script>
</body>
</html>